package com.hframe.http.servlet;

import com.google.gson.JsonElement;
import com.hframe.http.client.ResponseData;
import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import java.io.IOException;


public class HttpSkipServletResponse extends HttpServletResponseWrapper {
    private static Logger log = Logger.getLogger(HttpSkipServletResponse.class);


    public HttpSkipServletResponse(HttpServletResponse response) {
        super(response);
    }


    public void write(ResponseData responseData) throws IOException {
        JsonElement json = responseData.getJson();
        getOutputStream().write(json.toString().getBytes("UTF-8"));
    }
}
